//
//  ListNovel2CollectionViewCell.m
//  Read
//
//  Created by lanou on 15/12/18.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "ListNovel2CollectionViewCell.h"
#import "Novel.h"
#import "UIImageView+AFNetworking.h"

@implementation ListNovel2CollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        
        _backView = [[UIView alloc] initWithFrame:(CGRectMake(5, 5, self.frame.size.width - 10, self.frame.size.height - 10))];
        _backView.backgroundColor = [UIColor whiteColor];
        [self addSubview:_backView];
        
        _pictureView = [[UIImageView alloc] initWithFrame:(CGRectMake(5, 5, 100, 120))];
        _pictureView.backgroundColor = kMyColor;
        [self.backView addSubview:_pictureView];
        
        _bookNameLabel = [[UILabel alloc] initWithFrame:(CGRectMake(110, 10, 100, 30))];
        
        _authorLabel = [[UILabel alloc] initWithFrame:(CGRectMake(110, 40, 100, 30))];
        [self.backView addSubview:_authorLabel];
        
        _decLable = [[UILabel alloc] initWithFrame:(CGRectMake(110, 70, 200, 50))];
        _decLable.numberOfLines = 0;
        [self.backView addSubview:_decLable];
    }
    return self;
}


- (void)setNovel:(Novel *)novel {
    
    if (_novel != novel) {
        [self.pictureView setImageWithURL:[NSURL URLWithString:novel.coverImgUrl] placeholderImage:[UIImage imageNamed:@"344334_bw.jpg"]];
        self.bookNameLabel.text = novel.book_name;
        self.authorLabel.text = novel.author;
        
    }
    
    
}




@end
